//
//  HomeLoopWebViewController.m
//  AoJi
//
//  Created by MinwenYi on 15-3-3.
//  Copyright (c) 2015年 xuanheng. All rights reserved.
//

#import "HomeLoopWebViewController.h"

@interface HomeLoopWebViewController ()
{
    UIWebView *webview;
    
}
@end

@implementation HomeLoopWebViewController

@synthesize leftSwipeGestureRecognizer;
- (void)viewDidLoad {
    self.leftSwipeGestureRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipes:)];
    self.leftSwipeGestureRecognizer.direction = UISwipeGestureRecognizerDirectionRight;
    [self.view addGestureRecognizer:self.leftSwipeGestureRecognizer];
    
    
    self.ctitleLabel.backgroundColor=[UIColor yellowColor];
    [super viewDidLoad];
    
    self.ctitleLabel.text=self.ctitle;
    
    NSURL  *url=[NSURL URLWithString:self.urlString];
    NSURLRequest *request=[NSURLRequest requestWithURL:url];
    
    webview =[[UIWebView alloc]initWithFrame:CGRectMake(0, self.headerHeight, Mainwidth, MainHeight-self.headerHeight)];
   
    for (UIScrollView *tem in webview.subviews) {
        if ([tem isKindOfClass:[UIScrollView class]]) {
            tem.showsVerticalScrollIndicator=NO;
            tem.bounces=NO;
        }
       
    }
    
    
    [self.view addSubview:webview];
    webview.delegate=self;
    [webview loadRequest:request];
    
    
    
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)handleSwipes:(UISwipeGestureRecognizer *)sender
{
    if (sender.direction == UISwipeGestureRecognizerDirectionRight) {
        [self.navigationController popViewControllerAnimated:YES];
        
    }
    
}

@end
